fix: warn when sudo password is ignored outside exec#202
Merged
Conversation
Tighten the issue #200 follow-up so -S is treated as applicable only for exec paths that can actually inject sudo responses. Interactive shells now warn instead of silently ignoring the flag, and local-only dispatcher paths avoid collecting an unused SSH password. Tests cover the sudo and SSH password applicability helpers for exec, interactive, ping, list, and cache-stat paths.
Remove an unnecessary into_iter call in the internal SFTP crate so the repository-level CI command cargo clippy -- -D warnings passes on the newer clippy version used by GitHub Actions.
Member
Author
Review / Finalization SummaryScope Reviewed
Findings
Security Review
Performance Review
Validation
Remaining Risk
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-Son interactive shells, where automatic sudo-response injection is not implemented and the flag was previously silently ignored.--passwordin dispatcher paths that do not create SSH connections (list,cache-stats) ifdispatch_command()is called directly.Review Notes
Arc<Password>through exec, ping, SFTP, interactive, jump-host, and legacy command paths. This PR closes the remaining applicability gap for ignored flags.Test Plan
cargo test --bin bssh dispatcher::testscargo test --lib security::passwordcargo test --lib ssh::authcargo test --lib jump::chaincargo test --libcargo test --bin bsshcargo fmt --all -- --checkcargo check --lib --bins --testscargo clippy --lib --bins --tests -- -D warnings